package com.pearadmin.modules.sys.service.impl;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.pearadmin.common.web.domain.request.PageDomain;
import com.pearadmin.modules.sys.domain.WorkOperateDetail;
import com.pearadmin.modules.sys.mapper.WorkOperateDetailMapper;
import com.pearadmin.modules.sys.service.IWorkOperateDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 运行工作详情Service业务层处理
 *
 * @author Mr.Ling
 * @date 2021-12-14
 */
@Service
public class WorkOperateDetailServiceImpl implements IWorkOperateDetailService {
    @Autowired
    private WorkOperateDetailMapper workOperateDetailMapper;

    /**
     * 查询运行工作详情
     *
     * @param id 运行工作详情ID
     * @return 运行工作详情
     */
    @Override
    public WorkOperateDetail selectWorkOperateDetailById(String id) {
        return workOperateDetailMapper.selectWorkOperateDetailById(id);
    }

    /**
     * 查询运行工作详情列表
     *
     * @param workOperateDetail 运行工作详情
     * @return 运行工作详情
     */
    @Override
    public List<WorkOperateDetail> selectWorkOperateDetailList(WorkOperateDetail workOperateDetail) {
        return workOperateDetailMapper.selectWorkOperateDetailList(workOperateDetail);
    }

    /**
     * 查询运行工作详情
     * @param workOperateDetail 运行工作详情
     * @param pageDomain
     * @return 运行工作详情 分页集合
     * */
    @Override
    public PageInfo<WorkOperateDetail> selectWorkOperateDetailPage(WorkOperateDetail workOperateDetail, PageDomain pageDomain) {
        PageHelper.startPage(pageDomain.getPage(), pageDomain.getLimit());
        List<WorkOperateDetail> data = workOperateDetailMapper.selectWorkOperateDetailList(workOperateDetail);
        return new PageInfo<>(data);
    }

    /**
     * 新增运行工作详情
     *
     * @param workOperateDetail 运行工作详情
     * @return 结果
     */

    @Override
    public int insertWorkOperateDetail(WorkOperateDetail workOperateDetail) {
        return workOperateDetailMapper.insertWorkOperateDetail(workOperateDetail);
    }

    /**
     * 修改运行工作详情
     *
     * @param workOperateDetail 运行工作详情
     * @return 结果
     */
    @Override
    public int updateWorkOperateDetail(WorkOperateDetail workOperateDetail) {
        return workOperateDetailMapper.updateWorkOperateDetail(workOperateDetail);
    }

    /**
     * 删除运行工作详情对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWorkOperateDetailByIds(String[] ids) {
        return workOperateDetailMapper.deleteWorkOperateDetailByIds(ids);
    }

    /**
     * 删除运行工作详情信息
     *
     * @param id 运行工作详情ID
     * @return 结果
     */
    @Override
    public int deleteWorkOperateDetailById(String id) {
        return workOperateDetailMapper.deleteWorkOperateDetailById(id);
    }

    @Override
    public List<WorkOperateDetail> getDetailById(String operateId) {
        return workOperateDetailMapper.getDetailById(operateId);
    }
}
